	
$(function() {

	$("#a_look").on("click", function(e) {
		$(".look").show();
		$(document).bind('click', function(e) {
				var e = e || window.event; //浏览器兼容性 
				var elem = e.target || e.srcElement;
				while (elem) { //循环判断至跟节点，防止点击的是div子元素 
					if (elem.className && elem.className == 'look') {
						return;
					}
					elem = elem.parentNode;
				}
				$('.look').css('display', 'none'); //点击的不是div或其子元素 
			});
		e.stopPropagation();

	})

})

//餐桌弹窗
$(function() {

	$(".operate").on("click", function(e) {
		$(".dinner").show();
		$(document).bind('click', function(e) {
				var e = e || window.event;    //浏览器兼容性 
				var elem = e.target || e.srcElement;
				while (elem) { //循环判断至跟节点，防止点击的是div子元素 
					if (elem.className && elem.className == 'dinner') {
						return;
					}
					elem = elem.parentNode;
				}
				$('.dinner').css('display', 'none'); //点击的不是div或其子元素 
			});
		e.stopPropagation();

	})
	
	$(".switch-box").click(function(){
		console.dir($(".switch-box-label"));
	})
	
	
	
	//已未预定切换
	var count =0;
	if (count % 2 ===0) {
		$(".switch-box-label").html("未预定");
	} else{
		$(".switch-box-label").html("已预定");
	}
	
	$(".switch-box-input").click(function(){
		count++;
		if (count % 2 ===0) {
			$(".switch-box-label").html("未预定");
		} else{
			$(".switch-box-label").html("已预定");
		}
	})


	
	

})
		


